hsadnv: Replace invalid waypoint allocation.
authoroliskoli <oliskoli>
Tue, 26 Aug 2008 20:52:36 +0000 (20:52 +0000)
committeroliskoli <oliskoli>
Tue, 26 Aug 2008 20:52:36 +0000 (20:52 +0000)
hsa_ndv.c

index 527bcba635c134885b9bcbde7b6115bd826fd6ef..1ceb8fd367a0de7ad3eed2156debc6e053885c6a 100644 (file)
--- a/hsa_ndv.c
+++ b/hsa_ndv.c
@@ -86,7 +86,7 @@ hsa_ndv_start(void *data, const XML_Char *xml_el, const XML_Char **attr)
        }
        else if (strcmp(el, "Object") == 0)
        {
-               wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
+               wpt_tmp = waypt_new();
                wpt_tmp->altitude = unknown_alt;
                in_Object++;
        }
@@ -404,8 +404,7 @@ static void readVersion4(gbfile* pFile)
 
                memset(attr, 0, sizeof(attr));
 
-               wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
-               wpt_tmp->altitude = unknown_alt;
+               wpt_tmp = waypt_new();
 
                // read the first record
                if( !readRecord( pFile, EF_NVER_REC, recData) )